import { createStore } from 'vuex'
import user from './user'
import shopCar from './shopCar'
import category from './category'

import persistedstate from 'vuex-persistedstate'

export default createStore({
    modules: {
        user,
        shopCar,
        category 
    },
    // 持久化配置项
    plugins: [
        // 默认存在localStorage
        persistedstate({
            key: 'ecommerce-web-store',
            paths: ['user', 'shopCar', 'category']
        })
    ]
})